package com.blogjlh.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


/**
 * Created by jlh on 2017/6/7.
 */
@RefreshScope
@RestController
public class DemoController {
    private final Logger logger = Logger.getLogger(getClass());
    @Value("${from}")
    private String from;

    @RequestMapping(value = "/add" ,method = RequestMethod.GET)
    public Integer add(@RequestParam Integer a, @RequestParam Integer b) {
        Integer r = a + b;
        return r;
    }

    @RequestMapping(value = "/from",method = RequestMethod.GET)
    public String from (){
        return from;
    }

}
